const { defineConfig } = require("@vue/cli-service");
module.exports = defineConfig({
  transpileDependencies: true,
  // 关闭eslint检查
  lintOnSave: false,

  pluginOptions: {
    electronBuilder: {
      preload: "src/preload.js",
      // 打包配置
      builderOptions: {
        // 产品名称
        productName: "微信机器人",
        // 应用ID
        appId: "com.wxbot.app",
        // 打包文件夹
        directories: {
          output: "dist_electron",
        },
        // 打包选项
        win: {
          icon: "public/favicon.png",
          target: [
            {
              target: "nsis",
              arch: ["x64"],
            },
          ],
        },
        // Windows安装程序选项
        nsis: {
          oneClick: false, // 不是一键安装
          allowToChangeInstallationDirectory: true, // 允许用户选择安装位置
          shortcutName: "微信机器人", // 快捷方式名称
          perMachine: false, // 是否为每个用户安装
          runAfterFinish: true, // 安装完成后运行应用
        },
        // 资源文件配置
        extraResources: [
          {
            from: "resources/",
            to: "resources/",
            filter: ["**/*"],
          },
        ],
        // Mac设置
        mac: {
          icon: "public/app.icns",
          category: "public.app-category.utilities",
          target: ["dmg", "zip"],
        },
      },
    },
  },
});
